#pragma once

#include "net.h"

namespace ann
{

class net_bp: public net
{
public:
    net_bp(); // default for three layer
    net_bp(const uVec& pLStruct);
    virtual ~net_bp(void);

public:
    //specified for the homework: bp_xor problem
    const double SimS(const double p1, const double p2)
    {
        dVec inVec;
        dVec outVec;
        inVec.push_back(p1);
        inVec.push_back(p2);

        Sim(inVec, &outVec);

        return *outVec.begin();
    }

public:
    const UINT Init(const wchar_t* pInitFile = NULL);
    const UINT Reset();
    const UINT Train();
    const UINT InitFromFile(const wchar_t* pInitFile);
    const UINT Sim(const dVec& pInVec, dVec* pOutVec = NULL);


private:
    const UINT   TestConverge();

private:
    const UINT PropogateBack(const dVec& pObjVec, const dVec& pInVec);
};

}
